<template>
	<div>
		<div style="display: inline-block;">
			<span>认证类型：</span>
			<el-select v-model="classify" style="width:150px;margin-left: 10px;" @change="select()">
				<el-option v-for="item in classlyList" :key="item.value" :label="item.label" :value="item.value">
				</el-option>
			</el-select>&nbsp;&nbsp;
			<span>认证状态：</span>
			<el-select v-model="status" style="width:150px;margin-left: 10px;" @change="select()">
				<el-option v-for="item in statesnum" :key="item.value" :label="item.label" :value="item.value">
				</el-option>
			</el-select>&nbsp;&nbsp;
			<div style="position: relative;display: inline-block;">
				<span>认证姓名：</span>
				<el-input style="width: 200px;" @keydown.enter.native="select" placeholder="请输入姓名" v-model="userName">
				</el-input>&nbsp;&nbsp;
			</div>
			<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="select">查询
			</el-button>
			<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="cleans">重置
			</el-button>
		</div>
		<el-table v-loading="tableDataLoading" :data="tableData.list">
			<el-table-column prop="id" label="编号" width="80" fixed="left">
			</el-table-column>
			<el-table-column prop="name" label="认证类型" width="100" fixed="left">
				<template slot-scope="scope">
					<span style="color: #4f9dec;cursor: pointer;">{{scope.row.authentication==2 ? '陪护认证' :
						'陪诊认证'}}</span>
				</template>
			</el-table-column>
			<el-table-column prop="serviceName" label="服务项目" width="200">
			</el-table-column>
			<el-table-column prop="name" label="姓名" width="100" fixed="left">
				<template slot-scope="scope">
					<!-- <span style="color: #4f9dec;cursor: pointer;"
						@click="updates(scope.row)">{{scope.row.name ? scope.row.name : '未绑定'}}</span> -->
					<el-button size="mini" style="color: #008000;background: #fff;border: none;padding: 0;"
						type="primary" :disabled="!isAuth('userList:details')" @click="updates(scope.row)">
						{{scope.row.name ? scope.row.name : '未绑定'}}
					</el-button>
				</template>
			</el-table-column>
			<el-table-column prop="avatar" label="头像" width="150">
				<template slot-scope="scope">
					<div v-if="scope.row.avatar == null || scope.row.avatar == ''">
						暂无图片
					</div>
					<el-image v-if="scope.row.avatar" :src="scope.row.avatar" :preview-src-list="[scope.row.avatar]"
						style="width: 50px; height: 50px">
						<div slot="error" class="image-slot">
							<i class="el-icon-picture-outline"></i>
						</div>
					</el-image>
				</template>
			</el-table-column>
			<el-table-column prop="phone" label="电话" width="150">
				<template slot-scope="scope">
					<span>{{scope.row.phone }}</span>
				</template>
			</el-table-column>
			<el-table-column prop="birth" label="出生日期" width="100">
				<template slot-scope="scope">
					<span>{{scope.row.birth }}</span>
				</template>
			</el-table-column>
			<el-table-column prop="sex" label="性别" width="80">
				<template slot-scope="scope">
					<span v-if="scope.row.sex==1">男</span>
					<span v-if="scope.row.sex==2">女</span>
				</template>
			</el-table-column>
			<!-- <el-table-column prop="phone" label="类型" width="80">
				<template slot-scope="scope">
					<span v-if="scope.row.classify==1">个人</span>
					<span v-else-if="scope.row.classify==2">企业</span>
					<span v-else>无</span>
				</template>
			</el-table-column> -->

			<el-table-column prop="age" label="年龄">
			</el-table-column>
			<el-table-column prop="idNumber" label="身份证号码" width="200">
			</el-table-column>
			<el-table-column prop="front" label="身份证正面" width="150">
				<template slot-scope="scope">
					<div v-if="scope.row.front == null || scope.row.front == ''">
						暂无图片
					</div>
					<el-image v-if="scope.row.front" :src="scope.row.front" :preview-src-list="[scope.row.front]"
						style="width: 50px; height: 50px">
						<div slot="error" class="image-slot">
							<i class="el-icon-picture-outline"></i>
						</div>
					</el-image>
				</template>
			</el-table-column>
			<el-table-column prop="back" label="身份证反面" width="150">
				<template slot-scope="scope">
					<div v-if="scope.row.back == null || scope.row.back == ''">
						暂无图片
					</div>
					<el-image v-if="scope.row.back" :src="scope.row.back" :preview-src-list="[scope.row.back]"
						style="width: 50px; height: 50px">
						<div slot="error" class="image-slot">
							<i class="el-icon-picture-outline"></i>
						</div>
					</el-image>
				</template>
			</el-table-column>
			<el-table-column prop="aptitude" label="其他资质" width="150">
				<template slot-scope="scope">
					<div v-if="scope.row.aptitude">
						<!-- 遍历图片地址数组 -->
						<el-image v-for="(img, index) in scope.row.aptitude.split(',')" :key="index" :src="img"
							:preview-src-list="scope.row.aptitude.split(',')"
							style="width: 50px; height: 50px; margin-right: 5px;">
							<div slot="error" class="image-slot">
								<i class="el-icon-picture-outline"></i>
							</div>
						</el-image>
					</div>
					<div v-else>
						暂无图片
					</div>
				</template>
			</el-table-column>
			<el-table-column prop="workAge" label="护龄" width="160">
			</el-table-column>
			<el-table-column prop="details" label="自我介绍" width="160">
			</el-table-column>
			<el-table-column prop="shopType" label="服务地区" width="160">
				<template slot-scope="scope">
					<span>{{scope.row.province}}{{scope.row.city}}{{scope.row.district}}</span>
				</template>
			</el-table-column>
			<!-- <el-table-column prop="shopName" label="店铺/企业名称" width="160">
			</el-table-column>
			<el-table-column prop="shopType" label="店铺/企业类型">
			</el-table-column>
			<el-table-column prop="shopImg" label="店铺/企业LOGO" width="150">
				<template slot-scope="scope">
					<div v-if="scope.row.shopImg == null || scope.row.shopImg == ''">
						暂无图片
					</div>
					<div v-if="scope.row.shopImg" style="display:flex;flex-wrap: wrap;">
						<el-popover placement="top-start" title="" trigger="hover">
							<img style="width: 50px; height: 50px" :src="scope.row.shopImg" alt="" slot="reference">
							<img style="width: 200px; height: 200px" :src="scope.row.shopImg" alt="">
						</el-popover>
					</div>
				</template>
			</el-table-column>
			<el-table-column prop="addressImg" label="店铺/企业主页图" width="150">
				<template slot-scope="scope">
					<div style="display:flex;flex-wrap: wrap;">
						<div v-for="(item,index) in scope.row.addressImg" :key="index">
							<el-popover placement="top-start" title="" trigger="hover">
								<img style="width: 50px; height: 50px" :src="item" alt="" slot="reference">
								<img style="width: 200px; height: 200px" :src="item" alt="">
							</el-popover>
						</div>
					</div>
				</template>
			</el-table-column> -->
			<!-- <el-table-column prop="address" label="店铺地址" width="160">
			</el-table-column>
			<el-table-column prop="shopType" label="营业时间" width="160">
				<template slot-scope="scope">
					<span>{{scope.row.startTime}} - {{scope.row.endTime}}</span>
				</template>
			</el-table-column> -->


			<el-table-column prop="remek" label="审核内容" width="160">
			</el-table-column>
			<el-table-column prop="createTime" label="创建时间" width="160">
			</el-table-column>
			<el-table-column fixed='right' prop="status" label="状态" width="130">
				<template slot-scope="scope">
					<span v-if="scope.row.status == 0">待审核</span>
					<span v-if="scope.row.status == 1">审核成功</span>
					<span v-if="scope.row.status == 2">已拒绝</span>
				</template>
			</el-table-column>
			<el-table-column fixed='right' label="操作" width="160">
				<template slot-scope="scope">
					<el-button size="mini" type="primary" v-if="scope.row.status == 0"
						:disabled="scope.row.status !== 0 || !isAuth('autonym:jujue')" @click="refuseClick(scope.row)"
						style="margin: 5px;">
						拒绝
					</el-button>
					<el-button size="mini" type="primary" style="margin: 5px;" v-if="scope.row.status == 0"
						:disabled="scope.row.status !== 0 || !isAuth('autonym:tongguo')" @click="passClicks(scope.row)">
						通过
					</el-button>
					<el-button size="mini" type="primary" plain v-if="scope.row.status !== 0"
						:disabled="scope.row.status == 0 ||!isAuth('autonym:update')" @click="updateClicks(scope.row)"
						style="margin: 5px;">
						修改
					</el-button>
					<el-button size="mini" type="danger" :disabled="!isAuth('locality:delete')"
						@click="choidelete(scope.row)" style="margin: 5px;">删除
					</el-button>
				</template>
			</el-table-column>
		</el-table>
		<div style="text-align: center;margin-top: 10px;">
			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
				:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
				layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
			</el-pagination>
		</div>
		<!-- 服务拒绝弹框 -->
		<el-dialog title="审核拒绝" :visible.sync="dialogFormVisible" center>
			<div style="margin-bottom: 10px;">
				<span
					style="width: 200px;display: inline-block;text-align: right;position: relative;top: -70px;">拒绝理由：</span>
				<el-input style="width:50%;" v-model="content" type="textarea" :rows="4" placeholder="请输入拒绝理由">
				</el-input>
			</div>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible = false">取 消</el-button>
				<el-button type="primary" @click="refuseto()">确 定</el-button>
			</div>
		</el-dialog>
		<el-dialog title="修改认证信息" :visible.sync="dialogFormVisibleR" center width="80%">
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">认证类型：</span>
				<el-radio-group v-model="authentication" @change="authenBtn()">
					<el-radio :label="1">陪诊认证</el-radio>
					<el-radio :label="2">陪护认证</el-radio>
				</el-radio-group>
			</div>
			<!-- <div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">项目类型：</span>
				<el-select v-model="classifyIds" style="width:50%;margin-left: 10px;">
					<el-option v-for="item in fwData" :key="item.id" :label="item.value" :value="item.id">
					</el-option>
				</el-select>&nbsp;&nbsp;
			</div> -->
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">服务项目：</span>
				<div style="width: 50%;margin-left: 200px;position: relative;bottom: 25px;">
					<el-checkbox-group v-model="serviceIds">
						<el-checkbox v-for="(item,index) in fwData" :label="item.serviceId"
							:key="index">{{item.serviceName}}</el-checkbox>
					</el-checkbox-group>
				</div>

			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">姓名：</span>
				<el-input style="width:50%;" v-model="name" type="text" placeholder="请输入姓名"></el-input>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">电话：</span>
				<el-input style="width:50%;" v-model="phone" type="text" placeholder="请输入电话"></el-input>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">性别：</span>
				<el-radio-group v-model="sex">
					<el-radio :label="1">男</el-radio>
					<el-radio :label="2">女</el-radio>
				</el-radio-group>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">生日：</span>
				<el-date-picker style="width: 50%;" v-model="birth" align="right" type="date" format="yyyy年MM月dd日"
					value-format="yyyy年MM月dd日" placeholder="选择日期">
				</el-date-picker>&nbsp;&nbsp;&nbsp;
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">年龄：</span>
				<el-input style="width:50%;" v-model="age" type="number" :min="0" placeholder="请输入年龄"></el-input>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">服务地区：</span>
				<el-cascader style="width:50%" size="large" :options="options" ref="cascaderAddr" v-model="storeAddress"
					:placeholder="storeAddre" @change="handleChange55" :value="storeAddre">
				</el-cascader>
			</div>
			<div style="margin-bottom: 10px;" v-if="authentication==2">
				<span style="width: 200px;display: inline-block;text-align: right;">护龄：</span>
				<el-input style="width:50%;" v-model="workAge" type="number" placeholder="请输入护龄"></el-input>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">身份证号：</span>
				<el-input style="width:50%;" v-model="idNumber" type="text" placeholder="请输入身份证号"></el-input>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">自我介绍：</span>
				<el-input style="width:50%;" v-model="details" type="textarea" :rows="3"
					placeholder="请输入自我介绍"></el-input>
			</div>

			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">头像：</span>
				<div style="display: inline-block;">
					<el-upload class="avatar-uploader" v-model="avatar" :action="$http.adornUrl('alioss/upload')"
						:show-file-list="false" :on-success="handleAvatarSuccess5">
						<img v-if="avatar" :src="avatar" class="avatar" style="width: 148px;height: 148px;" />
						<i v-else class="el-icon-plus avatar-uploader-icon" style="font-size: 28px;color: #8c939d"></i>
					</el-upload>
				</div>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">身份证正面图：</span>
				<div style="display: inline-block;">
					<el-upload class="avatar-uploader" v-model="front" :action="$http.adornUrl('alioss/upload')"
						:show-file-list="false" :on-success="handleAvatarSuccess1">
						<img v-if="front" :src="front" class="avatar" style="width: 148px;height: 148px;" />
						<i v-else class="el-icon-plus avatar-uploader-icon" style="font-size: 28px;color: #8c939d"></i>
					</el-upload>
				</div>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">身份证反面图：</span>
				<div style="display: inline-block;">
					<el-upload class="avatar-uploader" v-model="back" :action="$http.adornUrl('alioss/upload')"
						:show-file-list="false" :on-success="handleAvatarSuccess2">
						<img v-if="back" :src="back" class="avatar" style="width: 148px;height: 148px;" />
						<i v-else class="el-icon-plus avatar-uploader-icon" style="font-size: 28px;color: #8c939d"></i>
					</el-upload>
				</div>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">其他资质：</span>
				<div class="imgs" v-for="(item,index) in certification" :key="index">
					<img width="100%" class="images" height="100%" :src="item" alt="">
					<span class="dels">
						<i class="el-icon-delete" @click="clear1(index)"></i>
					</span>
				</div>
				<div class="imgs"
					style=" width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
					<el-upload :action="$http.adornUrl('alioss/upload')" :show-file-list="false"
						:on-success="handleUploadSuccess3" :on-progress="onprogress1">
						<el-progress v-if="percentage1>0 && percentage1<100" type="circle"
							:percentage="percentage1"></el-progress>
						<i v-else class="el-icon-plus"></i>
					</el-upload>
				</div>
			</div>
			<!-- <div style="margin-bottom: 10px;display:flex;">
				<span style="width: 200px;display: inline-block;text-align: right;">形象照：</span>
				<div class="imgs" v-for="(item,index) in imagePhoto" :key="index">
					<img width="100%" class="images" height="100%" :src="item" alt="">
					<span class="dels">
						<i class="el-icon-delete" @click="clear2(index)"></i>
					</span>
				</div>
				<div class="imgs" style="width: 50%;">
					<el-upload :action="$http.adornUrl('alioss/upload')"
						list-type="picture-card" :show-file-list="false" :on-success="handleUploadSuccess4"
						:on-progress="onprogress1">
						<el-progress v-if="percentage1>0 && percentage1<100" type="circle"
							:percentage="percentage1"></el-progress>
						<i v-else class="el-icon-plus"></i>
					</el-upload>
				</div>
			</div> -->


			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisibleR = false">取 消</el-button>
				<el-button type="primary" @click="refusetoUp()">确 定</el-button>
			</div>
		</el-dialog>

	</div>
</template>

<script>
	import {
		jsonp
	} from 'vue-jsonp'
	import {
		provinceAndCityData,
		regionData,
		provinceAndCityDataPlus,
		regionDataPlus,
		CodeToText,
		TextToCode
	} from 'element-china-area-data'
	var cityOptions = []
	var geocoder, map, markersArray = [];
	export default {
		data() {
			return {
				imgUrlList: [],
				limit: 10,
				page: 1,
				content: '',
				status: '',
				statesnum: [{
					value: '',
					label: '全部'
				},
				{
					value: 0,
					label: '待审核'
				}, {
					value: 1,
					label: '审核成功'
				}, {
					value: 2,
					label: '拒绝'
				}
				],
				classify: '',
				classlyList: [{
					value: '',
					label: '全部'
				}, {
					value: 1,
					label: '陪诊认证'
				}, {
					value: 2,
					label: '陪护认证'
				}],
				userName: '',
				activeName: 'first',
				tableDataLoading: false,
				dialogFormVisible: false,
				tableData: {},
				checkBoxData: [], //多选框选择的值
				shopId: '',
				// ````
				birth: '',
				classifyIds: '',
				phone: '',
				name: '',
				sex: '',
				age: '',
				idNumber: '',
				front: '',
				back: '',
				avatar: '',
				address: '',
				userId: '',
				dialogFormVisibleR: false,
				userIds: '',
				percentage1: 0,
				certification: [],
				imagePhoto: [],
				info: {
					stockDate: this.getNowTime(), //日期
				},

				authentication: 1,
				workAge: '',
				province: '',
				city: '',
				district: '',
				options: regionData,
				storeAddress: [],
				storeAddre: '请选择城市',
				serviceIds: [],//服务项目
				fwData: [],
				details: '',
			}
		},
		methods: {


			//处理默认选中当前日期
			getNowTime() {
				var now = new Date()
				var year = now.getFullYear() //得到年份
				var month = now.getMonth() //得到月份
				var date = now.getDate() //得到日期
				month = month + 1
				month = month.toString().padStart(2, '0')
				date = date.toString().padStart(2, '0')
				var defaultDate = `${year}-${month}-${date}`
				return defaultDate
				this.$set(this.info, 'stockDate', defaultDate)
			},
			// 多选
			changeFun(val) {
				this.checkBoxData = val;
			},
			// 详情跳转
			updates(row) {
				this.$router.push({
					path: '/userDetail',
					query: {
						userId: row.userId
					}
				})
			},
			handleSizeChange(val) {
				this.limit = val;
				this.dataSelect()
			},
			handleCurrentChange(val) {
				this.page = val;
				this.dataSelect()
			},
			//服务通过
			passClick(id) {
				this.status = 1
				this.content = '同意'
				var ids = id ? [id] : this.checkBoxData.map(item => {
					return item.id
				})
				this.$http({
					url: this.$http.adornUrl(
						`student/auditStudentAuthentication/${ids}/${this.status}/${this.content}`),
					method: 'post',
					data: this.$http.adornData({})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.content = ''
								this.status = ''
								this.dataSelect()
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'error',
							duration: 1500,
							onClose: () => {
								this.content = ''
								this.status = ''
								this.dataSelect()
							}
						})
					}
				})
			},
			//单条服务通过
			passClicks(row) {
				this.status = 1
				this.content = '同意'
				this.$http({
					url: this.$http.adornUrl(`userCertification/auditorUserCertification`),
					method: 'post',
					params: this.$http.adornParams({
						'status': this.status,
						'id': row.id,
						'remek': '通过'
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.content = ''
								this.status = ''
								this.dataSelect()
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'error',
							duration: 1500,
							onClose: () => {
								this.content = ''
								this.status = ''
								this.dataSelect()
							}
						})
					}
				})
			},
			//服务拒绝
			refuseClick(rows) {
				this.status = 2
				this.shopId = rows.id
				this.helpTakeId = rows.userId
				this.content = ''
				this.dialogFormVisible = true
			},
			refuseto() {
				if (this.content == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '请输入拒绝理由',
						type: 'warning'
					});
					return
				}
				this.$http({
					url: this.$http.adornUrl(`userCertification/auditorUserCertification`),
					method: 'post',
					params: this.$http.adornParams({
						'status': this.status,
						'id': this.shopId,
						'remek': this.content
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.dialogFormVisible = false
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.content = ''
								this.status = ''
								this.dataSelect()
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'error',
							duration: 1500,
							onClose: () => {
							}
						})
					}

				})
			},
			// 查询
			select() {
				this.page = 1
				this.limit = 10
				this.dataSelect()
			},
			// 重置
			cleans() {
				this.status = ''
				this.userName = ''
				this.classify = ''
				this.dataSelect()
			},
			// 获取派单数据列表
			dataSelect() {
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('userCertification/queryCertification'),
					method: 'get',
					params: this.$http.adornParams({
						'page': this.page,
						'limit': this.limit,
						'status': this.status,
						'name': this.userName,
						'authentication': this.classify
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					for (var i in data.data.list) {
						if (data.data.list[i].addressImg) {
							data.data.list[i].addressImg = data.data.list[i].addressImg.split(',')
						}
					}
					this.tableData = data.data
				})
			},
			// 修改实名信息
			updateClicks(row) {
				this.birth = row.birth
				this.ids = row.id
				this.classifyIds = row.classifyId
				this.name = row.name
				this.sex = row.sex
				this.address = row.address
				this.percentage1 = 0
				if (row.aptitude) {
					this.certification = row.aptitude.split(',')
				} else {
					this.certification = []
				}
				if (row.serviceIds) {
					this.serviceIds = row.serviceIds.split(',')
					for (var i in this.serviceIds) {
						this.serviceIds[i] = Number(this.serviceIds[i])
					}
				} else {
					this.serviceIds = []
				}

				this.details = row.details
				this.imagePhoto = row.imagePhoto
				this.phone = row.phone
				this.idNumber = row.idNumber
				this.age = row.age
				this.front = row.front
				this.avatar = row.avatar
				this.back = row.back
				this.authentication = row.authentication
				this.workAge = row.workAge
				this.province = row.province
				this.city = row.city
				this.district = row.district
				if (row.province || row.city || row.district) {
					this.storeAddre = row.province + '/' + row.city + '/' + row.district
				} else {
					this.storeAddre = '请选择城市'
					this.storeAddress = []
				}

				this.userId = row.userId
				if (this.authentication == 1) {
					var authentications = 1
					this.fuwuSelect(authentications)
				} else {
					var authentications = 2
					this.fuwuSelect(authentications)
				}
				// this.fuwuSelect(row.authentication) 
				this.dialogFormVisibleR = true
			},
			refusetoUp() {
				if (this.name == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '姓名不能为空',
						type: 'warning'
					});
					return
				}
				if (this.phone == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '电话不能为空',
						type: 'warning'
					});
					return
				}
				if (this.birth == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '生日不能为空',
						type: 'warning'
					});
					return
				}
				if (this.authentication == 2) {
					if (this.workAge == '') {
						this.$notify({
							title: '提示',
							duration: 1800,
							message: '护龄不能为空',
							type: 'warning'
						});
						return
					}
				}
				if (this.details == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '自我介绍不能为空',
						type: 'warning'
					});
					return
				}

				if (this.serviceIds.length == 0) {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '请选择服务项目',
						type: 'warning'
					});
					return
				}

				if (this.idNumber == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '身份证号不能为空',
						type: 'warning'
					});
					return
				}
				if (this.avatar == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '头像不能为空',
						type: 'warning'
					});
					return
				}
				if (this.front == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '身份证正面不能为空',
						type: 'warning'
					});
					return
				}
				if (this.back == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '身份证反面图不能为空',
						type: 'warning'
					});
					return
				}
				this.$http({
					url: this.$http.adornUrl('userCertification/updateUserCertification'),
					method: 'post',
					data: this.$http.adornData({
						'userId': this.userId,
						'authentication': this.authentication,
						'name': this.name,
						'sex': this.sex,
						// 'address':this.address,
						'aptitude': this.certification.toString(),
						'serviceIds': this.serviceIds.toString(),
						'phone': this.phone,
						'sex': this.sex,
						'idNumber': this.idNumber,
						'age': this.age,
						'front': this.front,
						'avatar': this.avatar,
						'back': this.back,
						'birth': this.birth,
						'id': this.ids,
						'workAge': this.workAge,
						'province': this.province,
						'city': this.city,
						'district': this.district,
						'details': this.details
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.dialogFormVisibleR = false
								this.dataSelect()
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => { }
						})
					}
				})
			},
			// 修改弹框
			handleAvatarSuccess1(file, fileList) {
				this.front = file.data
			},
			handleAvatarSuccess2(file, fileList) {
				this.back = file.data
			},
			handleAvatarSuccess5(file, fileList) {
				this.avatar = file.data
			},
			// 获取省市区
			handleChange55(value) {
				value = this.$refs['cascaderAddr'].currentLabels
				this.province = value[0]
				this.city = value[1]
				this.district = value[2]
				if (this.city == '市辖区') {
					this.city = this.province
				}
				console.log(this.$refs['cascaderAddr'].currentLabels)
			},
			//上传成功
			handleUploadSuccess3(file, fileList) {
				this.certification.push(file.data)
				console.log('this.contentImg', this.certification)
			},
			// 删除
			clear1(index) {
				this.certification.splice(index, 1);
			},
			onprogress1(event, file, fileList) {
				this.percentage1 = parseInt(event.percent)
			},
			// 删除信息
			choidelete(row) {
				let delid = row.id
				this.$confirm(`确定删除此条信息?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl('userCertification/deleteCertification'),
						method: 'post',
						params: this.$http.adornParams({
							'id': delid
						})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$message({
								message: '操作成功',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.dataSelect()
								}
							})
						} else {
							this.$message({
								message: data.msg,
								type: 'warning',
								duration: 1500,
								onClose: () => {
								}
							})
						}
					})
				}).catch(() => { })
			},
			// 获取服务项目
			fuwuSelect(id) {
				this.$http({
					url: this.$http.adornUrl('admin/hospitalEmploy/getEmployList'),
					method: 'get',
					params: this.$http.adornParams({
						'authentication': id
					})
				}).then(({
					data
				}) => {
					let returnData = data.data
					this.fwData = returnData
				})
			},
			// 切换类型
			authenBtn() {
				if (this.authentication == 1) {
					var authentications = 1
					this.fuwuSelect(authentications)
				} else {
					var authentications = 2
					this.fuwuSelect(authentications)
				}

				this.serviceIds = []
			},
		},
		mounted() {
			this.dataSelect()
		}
	};
</script>

<style>
	/* 全局样式 */
	.el-table .el-table__cell {
		position: static !important;
	}

	.imgs {
		position: relative;
		border-radius: 6px;
		width: 148px;
		height: 148px;
		margin-right: 10px;
		display: inline-block;
	}

	.dels {
		position: absolute;
		top: 0;
		left: 0;
		display: none;
	}

	.dels .el-icon-delete {
		line-height: 148px;
		padding-left: 58px;
		font-size: 25px;
		color: #fff;
	}

	.imgs:hover .dels {
		width: 100%;
		height: 100%;
		background: #000;
		display: block;
		opacity: 0.5;
	}
</style>